package com.mecuros.demo.controller;

import com.mecuros.common.core.util.R;
import com.mecuros.demo.api.dto.UserDTO;
import com.mecuros.demo.service.SysUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yujianbo
 * @Classname RegisterController
 * @Description 客户端注册功能 register.user = false
 * @Date 2022/4/17 5:09 下午
 */
@RestController
@RequestMapping("/register")
@RequiredArgsConstructor
@ConditionalOnProperty(name = "register.user", matchIfMissing = true)
public class RegisterController {

    private final SysUserService userService;

    /**
     * 注册用户
     * @param userDto 用户信息
     * @return success/false
     */
//    @Inner(value = false)
//    @SysLog("注册用户")
    @PostMapping("/user")
    public R<Boolean> registerUser(@RequestBody UserDTO userDto) {
        return userService.registerUser(userDto);
    }
}
